<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue"></script>
  <style>
    .transition {
      transition: 3s all ease;
    }
    .blue {
      background-color: blue;
    }
    .green {
      background-color: green;
    }
  </style>
</head>

<body>
  <div id="root"></div>
  <script>
    /* 
      1. css过渡案例

    */
    const app = Vue.createApp({
      template: `
      <div :class="animate">Hello World</div>
      <button @click="handleClick">动画</button>
    `,
      data() {
        return {
          animate: {
            transition: true,
            blue: true,
            green: false
          }
        }
      },
      methods: {
        handleClick() {
          this.animate.blue = !this.animate.blue
          this.animate.green = !this.animate.green
        }
      }
    })
    const vm = app.mount('#root');

  </script>
</body>

</html>